package com.cfec.educationplatform.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.Data;

/**
 * 练习历史和练习详情的中间表
 * @TableName bet_pra_history_result
 */
@TableName(value ="bet_pra_history_result")
@Data
public class BetPraHistoryResult {
    /**
     * id
     */
    @TableId
    private Long betPraId;

    /**
     * 用户id
     */
    private Long userId;

    /**
     * 历史信息id
     */
    private Long historyId;

    /**
     * 历史详情的id
     */
    private Long resultId;

    /**
     * 题库中题目id
     */
    private Integer practiceId;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 信息状态：0：弃用，1：使用
     */
    private String betProState;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        BetPraHistoryResult other = (BetPraHistoryResult) that;
        return (this.getBetPraId() == null ? other.getBetPraId() == null : this.getBetPraId().equals(other.getBetPraId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getHistoryId() == null ? other.getHistoryId() == null : this.getHistoryId().equals(other.getHistoryId()))
            && (this.getResultId() == null ? other.getResultId() == null : this.getResultId().equals(other.getResultId()))
            && (this.getPracticeId() == null ? other.getPracticeId() == null : this.getPracticeId().equals(other.getPracticeId()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getBetProState() == null ? other.getBetProState() == null : this.getBetProState().equals(other.getBetProState()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getBetPraId() == null) ? 0 : getBetPraId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getHistoryId() == null) ? 0 : getHistoryId().hashCode());
        result = prime * result + ((getResultId() == null) ? 0 : getResultId().hashCode());
        result = prime * result + ((getPracticeId() == null) ? 0 : getPracticeId().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getBetProState() == null) ? 0 : getBetProState().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", betPraId=").append(betPraId);
        sb.append(", userId=").append(userId);
        sb.append(", historyId=").append(historyId);
        sb.append(", resultId=").append(resultId);
        sb.append(", practiceId=").append(practiceId);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", betProState=").append(betProState);
        sb.append("]");
        return sb.toString();
    }
}